package com.gao.v_priorityblockingqueue;

/**
 * @author gao
 * @time 2021/04/27 21:56:38
 */
public class Person implements Comparable<Person> {

    private int id;
    private String name;

    public Person() {
    }

    public Person(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return this.id + ":" + this.name;
    }

    @Override
    public int compareTo(Person that) {
        int r = this.id > that.id ? 1 : (this.id == that.id ? 0 : -1);
        return r;
    }

}
